<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of v_rotqr2eu</title>
  <meta name="keywords" content="v_rotqr2eu">
  <meta name="description" content="V_ROTQR2EQ converts a real unit quaternion into the corresponding euler angles">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">v_mfiles</a> &gt; v_rotqr2eu.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for v_mfiles&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>v_rotqr2eu
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>V_ROTQR2EQ converts a real unit quaternion into the corresponding euler angles</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function e=v_rotqr2eu(m,q) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment">V_ROTQR2EQ converts a real unit quaternion into the corresponding euler angles
 Inputs: 
     M        a string of n characters from the set determining the order of rotation axes
              as listed below. Note that the control characters 'rdoOaA' may occur anywhere in the string:
                'x','y','z'    rotate around the given axis by the corresponding angle
                               given in e()
                '1','2','3'    90 degree rotation around x,y or z axis; doesn't use a value from e()
                '4','5','6'    180 degree rotation around x,y or z axis; doesn't use a value from e()
                '7','8','9'    270 degree rotation around x,y or z axis; doesn't use a value from e()
                'r','d'        all angles are given in radians or degrees  [default='r']
                'R','D'        all angles are given in radians or degrees and are negated
             'o','O','a','A'   selects whether to rotate the object or the coordinate axes and
                               whether the rotation axes remain fixed in space for consecutive
                               rotations (extrinsic) or else move with each rotation (intrinsic).
                                  'o' = object-extrinsic [default]
                                  'O' = object-intrinsic
                                  'a' = axes-extrinsic
                                  'A' = axes-intrinsic

     Q(4,...) array of quaternions</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="v_rotqr2ro.html" class="code" title="function r=v_rotqr2ro(q)">v_rotqr2ro</a>	ROTQR2RO converts a real quaternion to a 3x3 rotation matrix</li><li><a href="v_rotro2eu.html" class="code" title="function e=v_rotro2eu(m,r)">v_rotro2eu</a>	V_ROTRO2EU converts a 3x3 rotation matrix into the corresponding euler angles</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="v_rotqr2ro.html" class="code" title="function r=v_rotqr2ro(q)">v_rotqr2ro</a>	ROTQR2RO converts a real quaternion to a 3x3 rotation matrix</li></ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function e=v_rotqr2eu(m,q)</a>
0002 <span class="comment">%V_ROTQR2EQ converts a real unit quaternion into the corresponding euler angles</span>
0003 <span class="comment">% Inputs:</span>
0004 <span class="comment">%     M        a string of n characters from the set determining the order of rotation axes</span>
0005 <span class="comment">%              as listed below. Note that the control characters 'rdoOaA' may occur anywhere in the string:</span>
0006 <span class="comment">%                'x','y','z'    rotate around the given axis by the corresponding angle</span>
0007 <span class="comment">%                               given in e()</span>
0008 <span class="comment">%                '1','2','3'    90 degree rotation around x,y or z axis; doesn't use a value from e()</span>
0009 <span class="comment">%                '4','5','6'    180 degree rotation around x,y or z axis; doesn't use a value from e()</span>
0010 <span class="comment">%                '7','8','9'    270 degree rotation around x,y or z axis; doesn't use a value from e()</span>
0011 <span class="comment">%                'r','d'        all angles are given in radians or degrees  [default='r']</span>
0012 <span class="comment">%                'R','D'        all angles are given in radians or degrees and are negated</span>
0013 <span class="comment">%             'o','O','a','A'   selects whether to rotate the object or the coordinate axes and</span>
0014 <span class="comment">%                               whether the rotation axes remain fixed in space for consecutive</span>
0015 <span class="comment">%                               rotations (extrinsic) or else move with each rotation (intrinsic).</span>
0016 <span class="comment">%                                  'o' = object-extrinsic [default]</span>
0017 <span class="comment">%                                  'O' = object-intrinsic</span>
0018 <span class="comment">%                                  'a' = axes-extrinsic</span>
0019 <span class="comment">%                                  'A' = axes-intrinsic</span>
0020 <span class="comment">%</span>
0021 <span class="comment">%     Q(4,...) array of quaternions</span>
0022 
0023 <span class="comment">%</span>
0024 <span class="comment">% Outputs:</span>
0025 <span class="comment">%</span>
0026 <span class="comment">%     E(K,...)  K Euler angles in radians (or degrees if 'd' or 'D' specified) per quaternion where K is the number of 'xyz' characters in M.</span>
0027 <span class="comment">%               A positive rotation is clockwise if looking along the +ve axis away from the origin or anti-clockwise if 'R' or 'D' is given.</span>
0028 <span class="comment">%               The x, y, z axes form a right-handed triple.</span>
0029 <span class="comment">%</span>
0030 <span class="comment">% The string M specifies the seqeunce of axes about which the rotations are performed. There are 12</span>
0031 <span class="comment">% possible 3-character sequences that avoid consecutive repetitions. These are 'Euler angles' if</span>
0032 <span class="comment">% there is a repeated axis or 'Tait-Bryan angles' if not. Common choices are:</span>
0033 <span class="comment">% (1) 'zxz' the most common Euler angle set</span>
0034 <span class="comment">% (2) 'xyz' corresponds to 'roll, pitch, yaw' for an aeroplane heading in the x direction with y to</span>
0035 <span class="comment">%     the right and z down. The intrinsic equivalent is 'Ozyx' corresponding to 'yaw, pitch, roll'.</span>
0036 <span class="comment">% (3) 'z1z1z' involves 5 rotations, in which all the non-fixed rotations are around the z axis.</span>
0037 <span class="comment">%</span>
0038 <span class="comment">% The Euler angles are not, in general, unique. In particular:</span>
0039 <span class="comment">%  (1) v_roteu2ro('zxz',[a b c]) = v_roteu2ro('zxz',[a+pi -b c+pi])</span>
0040 <span class="comment">%  (2) v_roteu2ro('xyz',[a b c]) = v_roteu2ro('xyz',[a+pi pi-b c+pi])</span>
0041 
0042 <span class="comment">%</span>
0043 <span class="comment">%      Copyright (C) Mike Brookes 2007-2020</span>
0044 <span class="comment">%      Version: $Id: v_rotqr2eu.m 11260 2020-07-18 20:07:58Z dmb $</span>
0045 <span class="comment">%</span>
0046 <span class="comment">%   VOICEBOX is a MATLAB toolbox for speech processing.</span>
0047 <span class="comment">%   Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html</span>
0048 <span class="comment">%</span>
0049 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
0050 <span class="comment">%   This program is free software; you can redistribute it and/or modify</span>
0051 <span class="comment">%   it under the terms of the GNU General Public License as published by</span>
0052 <span class="comment">%   the Free Software Foundation; either version 2 of the License, or</span>
0053 <span class="comment">%   (at your option) any later version.</span>
0054 <span class="comment">%</span>
0055 <span class="comment">%   This program is distributed in the hope that it will be useful,</span>
0056 <span class="comment">%   but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
0057 <span class="comment">%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
0058 <span class="comment">%   GNU General Public License for more details.</span>
0059 <span class="comment">%</span>
0060 <span class="comment">%   You can obtain a copy of the GNU General Public License from</span>
0061 <span class="comment">%   http://www.gnu.org/copyleft/gpl.html or by writing to</span>
0062 <span class="comment">%   Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.</span>
0063 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
0064 
0065 <span class="keyword">if</span> nargout
0066     e=<a href="v_rotro2eu.html" class="code" title="function e=v_rotro2eu(m,r)">v_rotro2eu</a>(m,<a href="v_rotqr2ro.html" class="code" title="function r=v_rotqr2ro(q)">v_rotqr2ro</a>(q));
0067 <span class="keyword">else</span>
0068    <a href="v_rotqr2ro.html" class="code" title="function r=v_rotqr2ro(q)">v_rotqr2ro</a>(q); <span class="comment">% draw a cube</span>
0069 <span class="keyword">end</span></pre></div>
<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>